<template>
  <div style="height: 400px;" id="journeyStep1Chart6" ref="charts2">
  </div>
</template>
<script>
  export default {
    mounted() {
      this.drawchart()
    },
    methods: {
      drawchart() {
        var option = {
          tooltip: {
            trigger: 'item',
            formatter: "{a} <br/>{b}: {c} ({d}%)"
          },
/*          legend: {
            orient: 'vertical',
            x: 'left',
            data:['家庭和睦','饮食正常','自我学习','家属鼓励','经常与医生沟通','长期吸烟','应酬繁多','饮食不规律','粉尘暴露','费用承担困难','不配合治疗','家属放弃治疗']
          },*/
          series: [
            {
              name:'',
              type:'pie',
              selectedMode: 'single',
              radius: [0, '30%'],

              label: {
                normal: {
                  position: 'inner'
                }
              },
              labelLine: {
                normal: {
                  show: false
                }
              },
              data:[
                {value:479, name:'积极'},
                {value:535, name:'消极', selected:true},
              ]
            },
            {
              name:'患者行为',
              type:'pie',
              radius: ['55%', '70%'],
              data:[
                {value:15, name:'家庭和睦'},
                {value:7, name:'饮食正常'},
                {value:16, name:'自我学习'},
                {value:3, name:'经常与医生沟通'},
                {value:15, name:'长期吸烟'},
                {value:6, name:'应酬繁多'},
                {value:17, name:'饮食不规律'},
                {value:5, name:'粉尘暴露'},
              ]
            }
          ]
        };
        var mycharts = this.$echarts.init(this.$refs.charts2)
        mycharts.setOption(option)
      }
    }
  }
</script>
<style></style>
